package com.minelx.woods.task.core.sql;

import com.minelx.statementsplus.CombinedSql;
import com.minelx.statementsplus.MajorSql;
import com.minelx.woods.task.core.sql.appender.CollectionAppender;

// FIXME 2021/9/26  replace with:   factory method of CombinedSql
public class CombinedSqlBuilder {

	private final MajorSql source;

	private final SqlCollections sqlCollections;

	public CombinedSqlBuilder(MajorSql source) {
		this.source = source;
		sqlCollections = new SqlCollections();
	}
	public void collect(CollectionAppender mapping) {
		mapping.append(sqlCollections);
	}

	public CombinedSql build() {
		return new CombinedSql(source, sqlCollections.collections());
	}
}
